$OpenBSD: patch-src_init_cpp,v 1.2 2011/05/08 21:47:44 kili Exp $
--- src/init.cpp.orig	Sun Apr 17 16:56:56 2011
+++ src/init.cpp	Sun May  8 15:41:13 2011
@@ -473,9 +473,11 @@ void cleanup()
 	if (SDL_NumJoysticks() > 0)
 	{
 		SDL_JoystickEventState(SDL_DISABLE);
-		for (int i = 0 ; i < SDL_NumJoysticks() ; i++)
+		// Blobwars tries to open only the first joystick,
+		// so test only the first here as well.
+		if (SDL_JoystickOpened(0))
 		{
-			debug(("Closing Joystick #%d - %s...\n", i, SDL_JoystickName(i)));
+			debug(("Closing Joystick #%d - %s...\n", 0, SDL_JoystickName(0)));
 			SDL_JoystickClose(config.sdlJoystick);
 		}
 	}
